QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing NURB Patches

QuickDraw 3D provides routines that you can use to create and manipulate NURB patches. See "NURB Patches" for the definition of a NURB patch.

Q3NURBPatch_New

You can use the Q3NURBPatch_New function to create a new NURB patch.

TQ3GeometryObject Q3NURBPatch_New (
                     const TQ3NURBPatchData *nurbPatchData);
nurbPatchData
A pointer to a TQ3NURBPatchData structure.

DESCRIPTION

The Q3NURBPatch_New function returns, as its function result, a new NURB patch having the shape and attributes specified by the nurbPatchData parameter. If a new NURB patch could not be created, Q3NURBPatch_New returns the value NULL .

Q3NURBPatch_Submit

You can use the Q3NURBPatch_Submit function to submit an immediate NURB patch for drawing, picking, bounding, or writing.

TQ3Status Q3NURBPatch_Submit (
                     const TQ3NURBPatchData *nurbPatchData,
                     TQ3ViewObject view);
nurbPatchData
A pointer to a TQ3NURBPatchData structure.
view
A view.

DESCRIPTION

The Q3NURBPatch_Submit function submits for drawing, picking, bounding, or writing the immediate NURB patch whose shape and attribute set are specified by the nurbPatchData parameter. The NURB patch is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3NURBPatch_GetData

You can use the Q3NURBPatch_GetData function to get the data that defines a NURB patch and its attributes.

TQ3Status Q3NURBPatch_GetData (
                     TQ3GeometryObject nurbPatch,
                     TQ3NURBPatchData *nurbPatchData);
nurbPatch
A NURB patch.
nurbPatchData
On exit, a pointer to a TQ3NURBPatchData structure that contains information about the NURB patch specified by the nurbPatch parameter.

DESCRIPTION

The Q3NURBPatch_GetData function returns, through the nurbPatchData parameter, information about the NURB patch specified by the nurbPatch parameter. QuickDraw 3D allocates memory for the TQ3NURBPatchData structure internally; you must call Q3NURBPatch_EmptyData to dispose of that memory.

Q3NURBPatch_SetData

You can use the Q3NURBPatch_SetData function to set the data that defines a NURB patch and its attributes.

TQ3Status Q3NURBPatch_SetData (
                     TQ3GeometryObject nurbPatch,
                     const TQ3NURBPatchData *nurbPatchData);
nurbPatch
A NURB patch.
nurbPatchData
A pointer to a TQ3NURBPatchData structure.

DESCRIPTION

The Q3NURBPatch_SetData function sets the data associated with the NURB patch specified by the nurbPatch parameter to the data specified by the nurbPatchData parameter.

Q3NURBPatch_EmptyData

You can use the Q3NURBPatch_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3NURBPatch_GetData .

TQ3Status Q3NURBPatch_EmptyData (
                     TQ3NURBPatchData *nurbPatchData);
nurbPatchData
A pointer to a TQ3NURBPatchData structure.

DESCRIPTION

The Q3NURBPatch_EmptyData function releases the memory occupied by the TQ3NURBPatchData structure pointed to by the nurbPatchData parameter; that memory was allocated by a previous call to Q3NURBPatch_GetData .

Q3NURBPatch_GetControlPoint

You can use the Q3NURBPatch_GetControlPoint function to get a control point for a NURB patch.

TQ3Status Q3NURBPatch_GetControlPoint (
                     TQ3GeometryObject nurbPatch,
                     unsigned long rowIndex,
                     unsigned long columnIndex,
                     TQ3RationalPoint4D *point4D);
nurbPatch
A NURB patch.
rowIndex
A row index into the array of control points for the specified NURB patch.
columnIndex
A column index into the array of control points for the specified NURB patch.
point4D
On exit, the control point having the specified row and column indices in the controlPoints array of control points for the specified NURB patch.

DESCRIPTION

The Q3NURBPatch_GetControlPoint function returns, in the point4D parameter, the four-dimensional control point of the NURB patch specified by the nurbPatch parameter having the row and column indices rowIndex and columnIndex in the controlPoints array of control points.

Q3NURBPatch_SetControlPoint

You can use the Q3NURBPatch_SetControlPoint function to set a control point for a NURB patch.

TQ3Status Q3NURBPatch_SetControlPoint (
                     TQ3GeometryObject nurbPatch,
                     unsigned long rowIndex,
                     unsigned long columnIndex,
                     const TQ3RationalPoint4D *point4D);
nurbPatch
A NURB patch.
rowIndex
A row index into the array of control points for the specified NURB patch.
columnIndex
A column index into the array of control points for the specified NURB patch.
point4D
The desired four-dimensional control point.

DESCRIPTION

The Q3NURBPatch_SetControlPoint function sets the four-dimensional control point having the row and column indices rowIndex and columnIndex in the controlPoints array of control points of the NURB patch specified by the nurbPatch parameter to the point specified by the point4D parameter.

Q3NURBPatch_GetUKnot

You can use the Q3NURBPatch_GetUKnot function to get the value of a knot in the u parametric direction.

TQ3Status Q3NURBPatch_GetUKnot (
                     TQ3GeometryObject nurbPatch,
                     unsigned long knotIndex,
                     float *knotValue);
nurbPatch
A NURB patch.
knotIndex
An index into the uKnots field of the specified NURB patch.
knotValue
On exit, the value of the specified knot.

DESCRIPTION

The Q3NURBPatch_GetUKnot function returns, in the knotValue parameter, the knot value of the NURB patch specified by the nurbPatch parameter having the knot index specified by the knotIndex parameter in the uKnots array of u knots.

Q3NURBPatch_SetUKnot

You can use the Q3NURBPatch_SetUKnot function to set the value of a knot in the u parametric direction.

TQ3Status Q3NURBPatch_SetUKnot (
                     TQ3GeometryObject nurbPatch,
                     unsigned long knotIndex,
                     float knotValue);
nurbPatch
A NURB patch.
knotIndex
An index into the uKnots field of the specified NURB patch.
knotValue
The desired value of the specified knot.

DESCRIPTION

The Q3NURBPatch_SetUKnot function sets the knot value of the NURB patch specified by the nurbPatch parameter having the knot index specified by the knotIndex parameter in the uKnots array of u knots to the value specified by the knotValue parameter.

Q3NURBPatch_GetVKnot

You can use the Q3NURBPatch_GetVKnot function to get the value of a knot in the v parametric direction.

TQ3Status Q3NURBPatch_GetVKnot (
                     TQ3GeometryObject nurbPatch,
                     unsigned long knotIndex,
                     float *knotValue);
nurbPatch
A NURB patch.
knotIndex
An index into the vKnots field of the specified NURB patch.
knotValue
On exit, the value of the specified knot.

DESCRIPTION

The Q3NURBPatch_GetVKnot function returns, in the knotValue parameter, the knot value of the NURB patch specified by the nurbPatch parameter having the knot index specified by the knotIndex parameter in the vKnots array of v knots.

Q3NURBPatch_SetVKnot

You can use the Q3NURBPatch_SetVKnot function to set the value of a knot in the v parametric direction.

TQ3Status Q3NURBPatch_SetVKnot (
                     TQ3GeometryObject nurbPatch,
                     unsigned long knotIndex,
                     float knotValue);
nurbPatch
A NURB patch.
knotIndex
An index into the vKnots field of the specified NURB patch.
knotValue
The desired value of the specified knot.

DESCRIPTION

The Q3NURBPatch_SetVKnot function sets the knot value of the NURB patch specified by the nurbPatch parameter having the knot index specified by the knotIndex parameter in the vKnots array of v knots to the value specified by the knotValue parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |